package com.hzy.ioc.impl;

import com.hzy.ioc.Ink;

import java.awt.*;

/**
 * @Package: com.hzy.ioc.impl
 * @ClassName: ColorInk
 * @Author: 862982795
 * @CreateTime: 2021/07/03 8:46
 * @Description:彩色墨盒
 */
public class ColorInk implements Ink {
    /**
     * 打印彩色文字
     * @param red
     * @param green
     * @param blue
     * @return
     */
    @Override
    public String getColor(int red, int green, int blue) {
        Color color=new Color(red,green,blue);
        return "#"+Integer.toHexString(color.getRGB()).substring(2);
    }
}
